package com.rk.kbk.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rk.kbk.common.DateJsonDeserializer;
import com.rk.kbk.common.DateJsonSerializer;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @Contacts
 * @通讯录(contacts)
 * @version : Ver 1.0
 */
@Entity
public class Contacts implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * @备注:
	 * @字段:id BIGINT(19)
	 */
	@Id
	@GeneratedValue(strategy= GenerationType.IDENTITY)
	@GenericGenerator(name="auto-identity",strategy="identity")
	@Column(updatable = false, columnDefinition="BIGINT(19) COMMENT ''")
	private java.lang.Long id;

	/**
	 * @备注:关联商户id
	 * @字段:shop BIGINT(19)
	 */
	@ManyToOne
	@JoinColumn(name="shop", columnDefinition="BIGINT(19) COMMENT '关联商户id'")
	private User shop;

	/**
	 * @备注:用户id
	 * @字段:user BIGINT(19)
	 */
	@ManyToOne
	@JoinColumn(name="user", columnDefinition="BIGINT(19) COMMENT '用户id'")
	private User user;

	/**
	 * @备注:微信登录时间
	 * @字段:login_time DATETIME(19)
	 */
	@Column(columnDefinition="DATETIME(19) COMMENT '微信登录时间'")
	private java.util.Date loginTime;

	/**
	 * @备注:手机号
	 * @字段:phone VARCHAR(33)
	 */
	@Column(columnDefinition="VARCHAR(33) COMMENT '手机号'")
	private java.lang.String phone;

	/**
	 * @备注:地址id
	 * @字段:address INT(10)
	 */
	@ManyToOne
	@JoinColumn(name="address", columnDefinition="INT(10) COMMENT '地址id'")
	private Address address;

	/**
	 * @备注:
	 * @字段:gmt_datetime DATETIME(19)
	 */
	@Column(updatable = false, columnDefinition="DATETIME(19) COMMENT ''")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date gmtDatetime = new java.util.Date();

	/**
	 * @备注:
	 * @字段:upt_datetime DATETIME(19)
	 */
	@Column(columnDefinition="DATETIME(19) COMMENT ''")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date uptDatetime = new java.util.Date();





	public Contacts(){
	}

	public Contacts(
		java.lang.Long id
	){
		this.id = id;
	}



	public void setId(java.lang.Long id) {
		this.id = id;
	}

	public java.lang.Long getId() {
		return this.id;
	}

	public User getShop() {
		return shop;
	}

	public void setShop(User shop) {
		this.shop = shop;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public void setLoginTime(java.util.Date loginTime) {
		this.loginTime = loginTime;
	}

	public java.util.Date getLoginTime() {
		return this.loginTime;
	}


	public void setPhone(java.lang.String phone) {
		this.phone = phone;
	}

	public java.lang.String getPhone() {
		return this.phone;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public void setGmtDatetime(java.util.Date gmtDatetime) {
		this.gmtDatetime = gmtDatetime;
	}

	public java.util.Date getGmtDatetime() {
		return this.gmtDatetime;
	}


	public void setUptDatetime(java.util.Date uptDatetime) {
		this.uptDatetime = uptDatetime;
	}

	public java.util.Date getUptDatetime() {
		return this.uptDatetime;
	}

}
